//中国全部的省份数据库,配合china-region使用

const cn = require('china-region')

let provinces=[
  {
    name:"安徽省",
    code: getCityCode("安徽省"),
    items: getCity("安徽省")
  },
  {
    name:"浙江省",
    code: getCityCode("浙江省"),
    items: getCity("浙江省")
  },
  {
    name:"辽宁省",
    code: getCityCode("辽宁省"),
    items: getCity("辽宁省")
  },
  {
    name:"山西省",
    code: getCityCode("山西省"),
    items: getCity("山西省")
  },
  {
    name:"河北省",
    code: getCityCode("河北省"),
    items: getCity("河北省")
  },
  {
    name:"福建省",
    code: getCityCode("福建省"),
    items: getCity("福建省")
  },
  {
    name:"江西省",
    code: getCityCode("江西省"),
    items: getCity("江西省")
  },
  {
    name:"山东省",
    code: getCityCode("山东省"),
    items: getCity("山东省")
  },
  {
    name:"河南省",
    code: getCityCode("河南省"),
    items: getCity("河南省")
  },
  {
    name:"江苏省",
    code: getCityCode("江苏省"),
    items: getCity("江苏省")
  },
  {
    name:"黑龙江省",
    code: getCityCode("黑龙江省"),
    items: getCity("黑龙江省")
  },
  {
    name:"吉林省",
    code: getCityCode("吉林省"),
    items: getCity("吉林省")
  },
  {
    name:"湖北省",
    code: getCityCode("湖北省"),
    items: getCity("湖北省")
  },
  {
    name:"湖南省",
    code: getCityCode("湖南省"),
    items: getCity("湖南省")
  },
  {
    name:"广东省",
    code: getCityCode("广东省"),
    items: getCity("广东省")
  },
  {
    name:"广东省",
    code: getCityCode("广东省"),
    items: getCity("广东省")
  },
  {
    name:"海南省",
    code: getCityCode("海南省"),
    items: getCity("海南省")
  },
  {
    name:"四川省",
    code: getCityCode("四川省"),
    items: getCity("四川省")
  },
  {
    name:"贵州省",
    code: getCityCode("贵州省"),
    items: getCity("贵州省")
  },
  {
    name:"云南省",
    code: getCityCode("云南省"),
    items: getCity("云南省")
  },
  {
    name:"陕西省",
    code: getCityCode("陕西省"),
    items: getCity("陕西省")
  },
  {
    name:"甘肃省",
    code: getCityCode("甘肃省"),
    items: getCity("甘肃省")
  },
  {
    name:"青海省",
    code: getCityCode("青海省"),
    items: getCity("青海省")
  },
  {
    name:"台湾省",
    code: getCityCode("台湾省"),
    items: getCity("台湾省")
  },
];
// let provinces = provinces2.map((item)=>{
//   console.log(item);
// })
export default provinces;

function getCity(province){
  const code=cn.getCodeByProvinceName(province);
  return [...cn.getPrefectures(code)];
}

function getCityCode(value){//获取省份的code
  return cn.getCodeByProvinceName(value);
  // console.log(value);
}

// function getCounty(value) {
//   return cn.getCounties(value);
// }
